Skip to content

Allow to monitor Windows hosts#6803

Merged
fabaff merged 1 commit into
home-assistant:devfrom
fabaff:load-glances
Mar 27, 2017
Merged

Allow to monitor Windows hosts#6803
fabaff merged 1 commit into
home-assistant:devfrom
fabaff:load-glances

Conversation

@fabaff
Copy link
Copy Markdown
Member

@fabaff fabaff commented Mar 26, 2017

Description:

Catch the exception of Windows hosts as they don't provide load details.

Related issue (if applicable): fixes #6482

Example entry for configuration.yaml (if applicable):

sensor:
  - platform: glances
    host: IP_ADDRESS_WINDOWS_MACHINE
    resources:
    - 'processor_load'

Checklist:

If the code communicates with devices, web services, or third-party tools:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass

@mention-bot
Copy link
Copy Markdown

@fabaff, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob to be a potential reviewer.

Copy link
Copy Markdown
Member

@pvizeli pvizeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not faster if we check the os instead trow a exeption ever x seconds for out stack?

Copy link
Copy Markdown
Contributor

@emlove emlove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this implementation is preferable to checking the OS. Windows is one example but other OSes might behave the same, and other Windows versions could change behavior.

I think catching key errors is a pretty standard python practice. You could also branch with if 'load' in value:, but I'm not sure if there's a substantial difference.

@fabaff
Copy link
Copy Markdown
Member Author

fabaff commented Mar 27, 2017

As soon as I can get my hands on a Windows hosts I can probably provide a more robust solution.

@fabaff fabaff merged commit d027df5 into home-assistant:dev Mar 27, 2017
@fabaff fabaff deleted the load-glances branch March 27, 2017 20:11
@fabaff fabaff mentioned this pull request Apr 6, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Jul 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Glances 'processor_load' fails monitoring Windows Host

5 participants